package com.management.service.Impl;

import com.management.dao.MaterialsDao;
import com.management.po.Materials;
import com.management.service.MaterialsService;
import com.management.vo.MaterialsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author dff
 * 物品库存列表业务逻辑实现类
 * @version 1.0
 */
@Service
public class MaiterServiceImpl implements MaterialsService {

    @Autowired
    MaterialsDao materialsDao;

    @Override
    public List<MaterialsVO> findAll() {
        return materialsDao.findAll();
    }

    @Override
    public MaterialsVO findByMaterialsId(int materialsId) {
        return materialsDao.findByMaterialsId(materialsId);
    }

    @Override
    public List<MaterialsVO> findByCompanyId(int companyId) {
        return materialsDao.findByCompanyId(companyId);
    }

    @Override
    public List<Materials> findByMaterialsTypeId(int materialsTypeId) {
        return materialsDao.findByMaterialsTypeId(materialsTypeId);
    }

    @Override
    public List<Materials> findByWarehouseId(int warehouseId) {
        return materialsDao.findByWarehouseId(warehouseId);
    }

    @Override
    public List<Materials> findByMaterialsUnitId(int materialsUnitId) {
        return materialsDao.findByMaterialsUnitId(materialsUnitId);
    }

    @Override
    public int add(Materials materials) {
        return materialsDao.add(materials);
    }

    @Override
    public boolean update(Materials materials) {
        return materialsDao.update(materials)>0?true:false;
    }
}
